import React, { Component } from 'react'
import axios from 'axios'

export default class App extends Component {

  getCarData = () => {
    axios.get("http://localhost:5000/cars").then(res => {
      console.log(`成功`, res.data);
    }, err => {
      console.log('fail', err)
    })
  }

  render() {
    return (
      <div>
        <button onClick={this.getCarData}>点击获得car的数据</button>
      </div>
    )
  }
}
